#ifndef TRACKER_H
#define TRACKER_H

#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>

#include "debug.h"

#include "list.h"
#include "socketHandling.h"
#include "hashtable.h"
#include "utils.h"
#include "peer.h"
#include "file.h"

typedef struct
{
  hashtable* fileList;
  list* peerList;
} trackerData;

trackerData* globalTrackerData;

trackerData* createTrackerData();
void freeTrackerData(trackerData* td);
void addFileToTrackerData(char* fileHash, file* fileInfo);
void addSeederForFile(char* fileHash, peer* seeder);
void updatePeerFile();   
void dumpTrackerData();
int existSeederInList(peer* p, list* l);

//void peerDialog(peerConnectionData *connectionData);

#endif // TRACKER_H
